package com.xingda.packing.enums;

import lombok.Getter;

public enum WheelSurfaceType {
    GREEN(2, "左", "B", "绿"),
    RED(1, "右", "A", "红"),
    BLUE(3, "左", "C", "蓝"),
    PINK(4, "右", "D", "粉"),
    unkonw(-1, "#", "Z", "未知");

    /**
     * 根据AB面获得工字轮面类型
     */
    public static WheelSurfaceType getByAB(String ab) {
        for (WheelSurfaceType surfaceType : WheelSurfaceType.values()) {
            if (surfaceType.getAb().equalsIgnoreCase(ab)) {
                return surfaceType;
            }
        }
        return unkonw;
    }

    @Getter
    private final int number;
    @Getter
    private final String lr;
    @Getter
    private final String ab;
    @Getter
    private final String gr;

    WheelSurfaceType(int number, String lr, String ab, String gr) {
        this.number = number;
        this.lr = lr;
        this.ab = ab;
        this.gr = gr;
    }
}
